package com.df.gameserver;

import com.df.script.IScript;
import com.df.utils.ClassLoadUtil;
import com.msg.Move;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;

public class LoadTest {
    public static void main(String[] args) throws IOException {
        Move.C2S_SyncPosition.Builder builder = Move.C2S_SyncPosition.newBuilder();
        builder.setX(1)
                .setY(2)
                .setStr("sad息1");
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        builder.build().writeTo(out);
        byte[] bytes = out.toByteArray();
        Move.C2S_SyncPosition c2SSyncPosition = Move.C2S_SyncPosition.parseFrom(bytes);
        System.out.println(c2SSyncPosition);
        System.out.println("===========================");
        Move.C2S_SyncPosition.Builder builder2 = Move.C2S_SyncPosition.newBuilder();
        builder2.setX(1)
                .setY(2)
                .setStr("sad息");
//        ByteArrayOutputStream out2 = new ByteArrayOutputStream();
        builder2.build().writeTo(out);
        byte[] bytes2 = out.toByteArray();
        Move.C2S_SyncPosition c2SSyncPosition2 = Move.C2S_SyncPosition.parseFrom(bytes2);
        System.out.println(c2SSyncPosition2);
    }
    static void loadTest(){
        List<Class<IScript>> classes = ClassLoadUtil.loadClass("script.msg", IScript.class);
    }
}
